﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SLIC.Models.EntityModel.Job_ReSubmissions>>" %>

<%@ Import Namespace="MvcContrib.UI.Pager" %>
<%@ Import Namespace="MvcContrib.Pagination" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    ReSubmissions
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

 <%
        /// <summary>
        /// 
        ///  <title>SLIC</title>
        ///  <description>ReSubmission page for View Job Visit details list </description>
        ///  <copyRight>Copyright (c) 2011</copyRight>
        ///  <company>IronOne Technologies (Pvt)Ltd</company>
        ///  <createdOn>2011-08-05</createdOn>
        ///  <author></author>
        ///  <modification>
        ///     <modifiedBy></modifiedBy>
        ///      <modifiedDate></modifiedDate>
        ///     <description></description>
        ///  </modification>
        ///
        /// </summary>                                                                                 
    %>

<script type="text/javascript">
    function popitup(url) {
      //  alert("pop");
        newwindow = window.open(url, 'name', 'height=600,width=700,scrollbars=1');
        if (window.focus) { newwindow.focus() }
        return false;
    }
</script>
    <h2>
        Job Visits</h2>
    <%   ModelState err = ViewContext.ViewData.ModelState["err"];
         SLIC.Controllers.GenException result = null;

         if (err != null)
         {
             result = (SLIC.Controllers.GenException)err.Errors.ElementAt(0).Exception;
    %>
    <%:result.Message%>
    <%}
         else
         { %>
    <table id="grid">
        <tr>            
              <th scope="col" width="30px" >
                Type
            </th>
              <th scope="col" width="30px" >
                Comment
            </th>
              <th scope="col" width="30px" >
                Time Visited
            </th>           
              <th scope="col" width="30px" >
                Submitted By
            </th>
               <th scope="col" width="30px" >
                Submited Time
            </th>
            <th scope="col" width="30px" >
            Actions
            </th>         
        </tr>
           <%bool oddEven = true;
            %>
            
        <% foreach (var item in Model)
           { %>
           <%--   <%:Html.HiddenFor(item =>item.ToList()[i].ReSubmissionId)%>--%>
               <tr class="<%= (oddEven = !oddEven) ? "even" : "odd" %>">         
            <td class="normaltds" width="30px" style="padding-bottom:5px;">
             <%--   <%: Model.ToList()[i].ReSubmissionId%>--%>   <%: item.SubmissionType%>
            </td>
            <td class="normaltds" width="30px" style="padding-bottom:5px;">
                <%: item.Comment%>
            </td>
             <td class="normaltds" width="30px" style="padding-bottom:5px;">
                <%: String.Format("{0:g}", item.TimeVisited)%>
            </td>           
            <td class="normaltds" width="30px" style="padding-bottom:5px;">
                <%: item.CSR_UserName%>
            </td>
             <td class="normaltds" width="30px" style="padding-bottom:5px;">
                <%: String.Format("{0:g}", item.TimeSubmited)%>
            </td>
            <td class="normaltds" width="30px" style="padding-bottom:5px;text-align:center;">
             <%--   <input type="submit" onclick="showPopup('<%: Url.Action("PrintJob", "Job", new { JobId=Model.Id }) %>');return (false);"
            value="Print" class="button" />--%>
            <a href='<%= Url.Action("ViewVisitGallery", "Image", new { submissionId = item.ReSubmissionId })%>' >             
                    <img src="../../../Content/images/viewImages.png" border="0" alt="Images" title="Images" /></a>
             <a onclick='popitup("PrintReSubmission?submissionId=<%=item.ReSubmissionId%>")' href="javascript:void(0);">
             <img src="../../../Content/images/print.png" border="0" alt="Print Submission" title="Print Submission" /></a> 
                        
            <%--    <%: Html.ActionLink("Print", "PrintReSubmission", "Job", new { submissionId = item.ReSubmissionId }, null)%> --%>
        <%--       |  <a href='javascript:showPopup("Job/PrintReSubmission?submissionId="+<%=item.ReSubmissionId })%>");return (false);'>
                <%: Html.ActionLink("Images", "ViewVisitGallery", "Image", new { submissionId = item.ReSubmissionId }, null)%>--%>

             <%--    |
               <%: Html.ActionLink("Details", "Details", new { submissionId = item.ReSubmissionId })%>     --%>           
                <%-- | <%: Html.ActionLink("Delete", "Delete", new { id=item.ReSubmissionId })%>--%>
           
            </td>          
        </tr>       
        <% } %>
    </table>
    <%} %>
    <br />
    <div id="pager">
        <%= Html.Pager((IPagination)(Model as IEnumerable<SLIC.Models.EntityModel.Job_ReSubmissions>))%>
    </div>
       <div class="buttons" style="float: right;">
              <input type="button" onclick="window.history.back()" value="Back" class="button" /></div>
    <%--   
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
    --%>
</asp:Content>
